package org.hqs.patient.service;

import org.hqs.patient.mapper.PatientMapper;
import org.hqs.patient.pojo.Patient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientService {
    @Autowired
    private PatientMapper patientMapper;

    public Patient queryPatientById(Long patientId) {
        return patientMapper.findById(patientId);
    }

    public List<Patient> findAllPatients() {
        return patientMapper.findAllPatients();
    }

    public int insertPatient(Patient patient) {
        return patientMapper.insertPatient(patient);
    }

    public int updatePatient(Patient patient) {
        return patientMapper.updatePatient(patient);
    }

    public int deletePatientById(Long id) {
        return patientMapper.deletePatientById(id);
    }
}